<!--_meta 作为公共模版分离出去-->
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<LINK rel="Bookmark" href="/favicon.ico" >
<LINK rel="Shortcut Icon" href="/favicon.ico" />
<link rel="stylesheet" type="text/css" href="/static/admin/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="/static/admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="/static/admin/css/iconfont.css" />
<link rel="stylesheet" type="text/css" href="/static/admin/css/style.css" />
<!--百度编辑器-->
<!--<link rel="stylesheet" type="text/css" href="/static/umeditor/themes/default/css/umeditor.css">-->
<!--/meta 作为公共模版分离出去-->
<title>添加编辑</title>
</head>
<body ng-controller="main">
<article class="page-container">
	<form action="<?php url('activity/activityAdd')?>" method="post" class="form form-horizontal" id="form-add">
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>活动名称：</label>
			<div class="formControls col-xs-8 col-sm-10">
				<input type="text" class="input-text" value="<?php echo $info['name']?>" placeholder="请输入活动名称" id="name" name="name">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>活动描述：</label>
			<div class="formControls col-xs-8 col-sm-10">
				<input type="text" class="input-text" value="<?php echo $info['description']?>" placeholder="请输入活动描述" id="description" name="description">
			</div>
		</div>
        <div class="row cl" <?php if($flag) echo 'hidden';?>>
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>活动地点：</label>
            <div class="formControls col-xs-8 col-sm-10">
                <select class="select" name="bid" id="bid" size="1">
                    <option value="">请选择地点</option>
                    <?php foreach($business as $v):?>
                    <option value="<?php echo $v['id']?>" <?php if($v['id'] == $info['bid']) echo 'selected';?>><?php echo $v['name']?></option>
                    <?php endforeach; ?>
                </select>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>人数上限：</label>
            <div class="formControls col-xs-8 col-sm-10">
                <input type="text" class="input-text" value="<?php echo $info['join_max']?>" placeholder="请输入最大参与人数" id="join_max" name="join_max">
            </div>
        </div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>开始时间：</label>
			<div class="formControls col-xs-8 col-sm-10">
				<input type="text" name="begin_time" value="<?php echo date('Y-m-d H:i:s',$info['begin_time'])?>" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:00'})" id="datemin" class="input-text Wdate" style="width:300px">
			</div>
		</div>
		<!--<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>结束时间：</label>
			<div class="formControls col-xs-8 col-sm-10">
				<input type="text" name="end_time" value="<?php echo date('Y-m-d H:i:s',$info['end_time'])?>" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:00'})" id="datemax" class="input-text Wdate" style="width:300px">
			</div>
		</div>-->
		<div class="row cl" <?php if($flag) echo 'hidden';?>>
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>背景图片：</label>
			<div class="formControls col-xs-8 col-sm-10"> <span class="btn-upload form-group">
				<input class="input-text upload-url" type="text" name="image" id="uploadfile" />
				<a href="javascript:;" class="btn btn-primary radius upload-btn"><i class="Hui-iconfont">&#xe642;</i> 浏览文件</a>
				<input id="file" type="file" multiple name="image[]" class="input-file"  value="">
				</span>
				<img id="img" class="mt-10" src="<?php echo $pre.$info['background']?>">
			</div>
		</div>
		<!--百度编辑器-->
		<!--<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>文章内容：</label>
			<div class="formControls col-xs-8 col-sm-10">
				<textarea id="myEditor" style="width: 100%" name="content"><?php echo $info['content']?></textarea>
			</div>
		</div>-->
		<!--end-->
		<div class="row cl">
			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
				<input type="hidden" name="id" value="<?php echo $info['id']?>" />
				<input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
			</div>
		</div>
	</form>
</article>

<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="/static/admin/js/jquery.min.js"></script>
<script type="text/javascript" src="/static/admin/js/layer.js"></script>
<script type="text/javascript" src="/static/admin/js/H-ui.min.js"></script>
<script type="text/javascript" src="/static/admin/js/H-ui.admin.js"></script>
<script type="text/javascript" src="/static/admin/js/jquery.validate.js"></script>
<script type="text/javascript" src="/static/admin/js/validate-methods.js"></script>
<script type="text/javascript" src="/static/admin/js/messages_zh.js"></script>
<script type="text/javascript" src="/static/admin/lib/My97DatePicker/WdatePicker.js"></script>
<!--百度编辑器-->
<!--<script type="text/javascript" src="/static/umeditor/third-party/template.min.js"></script>
<script type="text/javascript" src="/static/umeditor/umeditor.config.js"></script>
<script type="text/javascript" src="/static/umeditor/umeditor.min.js"></script>
<script type="text/javascript" src="/static/umeditor/lang/zh-cn/zh-cn.js"></script>-->
<!--end-->
<!--/_footer /作为公共模版分离出去-->
<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript">
	$(function(){
		// 实例化编辑器
		var um = UM.getEditor('myEditor');
		$('.skin-minimal input').iCheck({
			checkboxClass: 'icheckbox-blue',
			radioClass: 'iradio-blue',
			increaseArea: '20%'
		});
		$("#form-add").validate({
			rules: {
				name: {required: true,maxlength:60},
				description: {required: true,maxlength:300},
                join_max: {required: true,number:true,max:1000},
				//myEditor: {required: true},
				datemin: {required: true}
			},
			onkeyup:false,
			focusCleanup:true,
			success:"valid",
			submitHandler:function(form){
				var options = {
					success: function (data) {
						if(data.code == 0){
							layer.msg(data.msg,{icon:1,time:1000});
							setInterval("closeWindow()",1000);
						}else{
							layer.msg(data.msg,{icon:5,time:1000});
						}
					}
				};
				$(form).ajaxSubmit(options);
			}
		});
	});
	function closeWindow() {
		var index = parent.layer.getFrameIndex(window.name);
		window.parent.location.reload();
	}
</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>